home *** CD-ROM | disk | FTP | other *** search
- <PUBLIC:HTC URN="shellctls"><ATTACH event="oncontentready" handler=_OnContentReady /><SCRIPT language="javascript">
- var _bLoading = true;
- var _idFor = null;
- var _szText = null;
- var _ichAccel = 0;
- var _chAccel;
- var c_szAccelStyle = "style = 'text-decoration:underline; accelerator:true'";
- element.attachEvent("onerror", _OnError);
- _GetPropertyDefaults();
- function get_forCtl() { return _idFor; }
- function put_forCtl(id)
- {
- if (_bLoading)
- return;
- _idFor = id;
- }
- function _OnContentReady()
- {
- _bLoading = false;
- _ScanForAccelerator();
- _CreateHTML();
- }
- function _GetPropertyDefaults()
- {
- if (element.forElem)
- _idFor = element.forElem;
- }
- function _ScanForAccelerator()
- {
- var sz = element.innerText;
- _ichAccel = sz.indexOf('&');
- _szText = sz.substring(0, _ichAccel);
- if (_ichAccel < sz.length - 1)
- _szText = _szText + sz.substring(_ichAccel+1, sz.length);
- if (0 <= _ichAccel)
- _chAccel = sz.charAt(_ichAccel+1);
- }
- function _CreateHTML()
- {
- element.innerHTML =
- '<LABEL id=idLblAccel_' + uniqueID + ' for=' + _idFor + ' accesskey="' + _chAccel + '">' +
- _szText.substring(0, _ichAccel) +
- '<SPAN ' + c_szAccelStyle + '>' +
- _szText.substring(_ichAccel, _ichAccel+1) +
- '</SPAN>' +
- _szText.substring(_ichAccel+1, _szText.length) +
- '</LABEL>';
- }
- function _OnError(szMsg, szUrl, iLine)
- {
- alert("An unexpected error occurred.\n\n" + szMsg + "\n" + szUrl + "\nLine: " + iLine);
- return true;
- }
- </SCRIPT><PROPERTY name="forElem" get=get_forCtl put=put_forCtl /></PUBLIC:HTC>